package com.liang.shiro;

import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.ByteSource;

public class MD5 {
	public static void main(String[] args) {
		//	  若要使用MD5加密，数据库中的密码也得是加密后的密码可以通过下面的方法获取明文密码对应的密文密码 
		String hashAlgorithName ="MD5";
		String password = "3";
		int hashIterations = 527;
		ByteSource credentialsSalt = ByteSource.Util.bytes("狂神");
		Object obj = new SimpleHash(hashAlgorithName, password, credentialsSalt,hashIterations);
		System.out.println(obj);
	}
}
